package com.iplay.thezen.prototype;

import java.util.ArrayList;

/**
 * @author dangwu
 * @since 2021/9/11 3:53 下午
 */
public class Thing implements Cloneable{
    private ArrayList<String> arrayList = new ArrayList<>();
    public Thing(){
        System.out.println("构造函数被执行了。。。。");
    }
    @Override
    public Thing clone() {
        Thing thing = null;
        try {
            thing = (Thing) super.clone();
            this.arrayList = (ArrayList<String>)this.arrayList.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return thing;
    }

    public void setValue(String value){
        this.arrayList.add(value);
    }

    public ArrayList<String> getValue(){
        return this.arrayList;
    }
}
